<?php require_once(getcwd()."/includes/session.php"); ?>
<?php require_once(getcwd()."/includes/connection.php"); ?>
<?php require_once(getcwd()."/includes/functions.php"); ?>
<?php confirm_logged_in(); ?>

<table id="structure">
	<tr>
		<td id="page">
			<h2>Create New User</h2>
			
			<form id='userfunc'>
			<table>
				<tr>
					<td>Username:</td>
					<td><input id='unadd' type="text" name="username" maxlength="30" value="" /></td>
				</tr>
				<tr>
					<td>Password:</td>
					<td><input id='pwadd' type="password" name="password" maxlength="30" value="" /></td>
				</tr>
				<tr>
					<td colspan="2"><button style='float:right;' id='adduser' name="submit">Create user</button></td>
				</tr>
			</table>
			</form>
			<h2>Delete User</h2>
			<select id='undel' name='username'>
			<?php
			
			$result = mysql_query("SELECT * from users") or die(mysql_error());
			while($row = mysql_fetch_array($result)){
			echo "<option>".$row['username']."</option>";
			}
			
			
			?>
			</select><button style='margin:5px;' id='deleteuser'>Delete User</button>
			<div class='dresponse'></div>
		</td>
	</tr>
</table>










